package com.zmx.user.service;

import com.zmx.common.common.service.BaseService;
import com.zmx.user.dto.SysUserDto;
import com.zmx.user.entity.SysUser;
import com.zmx.user.repository.UserRepository;
import com.zmx.user.service.mapper.UserMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description: 系统用户业务实现类
 * @ClassName: UserService
 * @Author zhaomxr
 * @Date 2021-11-05 16:37
 */
@Slf4j
@Service
public class UserService extends BaseService<SysUser, SysUserDto, UserRepository, UserMapper> {

    @Autowired
    private UserRepository userRepository;

    /**
     * 根据用户名，密码取用户信息
     * @param userName
     * @param password
     * @return
     */
    public SysUserDto getUserByUserName(String userName) {
        SysUser user = userRepository.findByUserName(userName);
        return this.entityToDto(user);
    }

}
